update variable_values 
set variable_value = REPLACE(variable_value, '<br />', ' ') 
where variable_id in
(select variable_id from variables where 
template_id in (select template_id from templates where
template_name like 'Settings'));